<html>
  <head>
    <meta charset="utf-8">
    <title>test array</title>
  </head>
  <body>

   <button id="btn" >查询</button>
             
  </body>
  <script src="http://cdn.bootcss.com/jquery/2.1.3/jquery.min.js"></script>

  <script>

      $("#btn").click(function() {
      	alert("233");

		sendDate();

});


  function sendDate () {
  	var array_input=new Array();
  	for(var i=0;i<2;i++){
  		array_input[i]=new Array();
  	}
  	array_input[0][0]=1;
  	array_input[0][1]=2;
  	array_input[1][0]=3;
  	array_input[1][1]=4;
  	// for (var i = array_input.length - 1; i >= 0; i--) {
  	// 	for (var j = array_input.length - 1; j >= 0; j--) {
  	// 		alert(array_input[i][j]);
  	// 	}  		
  	// }
  	var i,jsonstr;
	jsonstr="[{";
	for(i=0;i<array_input.length;i++)
	{
	jsonstr +=  "a"+i + ":" + "\"" +  array_input[1][i] + "\",";
	}
	jsonstr = jsonstr.substring(0,jsonstr.lastIndexOf(','));
	jsonstr += "}]";
	console.log(jsonstr);
	var data=eval('(' + jsonstr + ')'); //将json格式的字符串转化成json
	console.log(data);

    $.ajax({
      url:"test_ajax_array.php",
      data:{ "items": data},
      type:"POST",
      dataType:"json",
      beforeSend : function(xhr) {  
        //花式转菊花
      },
      success:function(data) {
        console.log(data);
      },
      error:function(error) {
        console.log("error");
      }
    });
  }
  </script>
</html>

